package com.huawei.appgallery.forum.message.activity;

import android.app.ActionBar;
import android.os.Bundle;
import android.view.View;
import android.widget.TextView;
import androidx.annotation.Nullable;
import com.huawei.appgallery.forum.base.ui.ForumActivity;
import com.huawei.appgallery.forum.message.api.ILauncherMsgSwitchSettingProtocol;
import com.huawei.appgallery.forum.message.api.ILauncherMsgSwitchSettingResult;
import com.huawei.hmf.annotation.ActivityDefine;
import java.lang.ref.WeakReference;
import o.bvj.a;
import o.bvj.e;
import o.bvj.j;
import o.AccountBussinessListener;
import o.ccp;
import o.cgv;
import o.eoj;
import o.evx;
import o.fho;
import o.fiu;
import o.fiv;
import o.fjb;
import o.fjm;
import o.FragmentTransaction;

@ActivityDefine(alias = "launcher_msg_setting_activity", protocol = ILauncherMsgSwitchSettingProtocol.class, result = ILauncherMsgSwitchSettingResult.class)
public class LauncherMsgSwitchSettingActivity extends ForumActivity {
    private fiv ˋॱ = fiv.ॱ(this);
    protected String ͺ = "";
    private TextView ॱˊ;

    static class d implements AccountBussinessListener {
        private WeakReference<LauncherMsgSwitchSettingActivity> ˏ;

        public d(LauncherMsgSwitchSettingActivity launcherMsgSwitchSettingActivity) {
            this.ˏ = new WeakReference(launcherMsgSwitchSettingActivity);
        }

        public void onAccountBusinessResult(ccp o_ccp) {
            LauncherMsgSwitchSettingActivity launcherMsgSwitchSettingActivity = (LauncherMsgSwitchSettingActivity) this.ˏ.get();
            if (launcherMsgSwitchSettingActivity != null && 103 == o_ccp.ˎ) {
                launcherMsgSwitchSettingActivity.finish();
            }
        }
    }

    public void onCreate(@Nullable Bundle bundle) {
        super.onCreate(bundle);
        ᐝ();
        getWindow().getDecorView().setBackgroundColor(getResources().getColor(a.ᐝ));
        cgv.ˋ(this, a.ˎ, a.ᐝ);
        eoj.ˋ().ˎ("LauncherMsgSwitchSettingActivity", new d(this));
        if (ͺ()) {
            ॱˊ();
            ॱ(bundle);
            return;
        }
        finish();
    }

    protected void ᐝ() {
        setContentView(e.ʻ);
    }

    protected boolean ͺ() {
        return true;
    }

    private void ॱˊ() {
        ActionBar actionBar = getActionBar();
        if (actionBar != null) {
            actionBar.hide();
        }
        View findViewById = findViewById(b.ˋᐝ);
        ˋ(findViewById);
        this.ॱˊ = (TextView) findViewById.findViewById(b.ˈॱ);
        ˊ(this.ॱˊ);
    }

    protected void ˊ(TextView textView) {
        textView.setText(getResources().getString(j.ˋॱ));
    }

    private void ˋ(View view) {
        view.findViewById(b.ˏˏ).setOnClickListener(new evx(this) {
            final /* synthetic */ LauncherMsgSwitchSettingActivity ॱ;

            {
                this.ॱ = r1;
            }

            public void ˋ(View view) {
                this.ॱ.onBackPressed();
            }
        });
    }

    protected void ॱ(Bundle bundle) {
        if (bundle == null) {
            fjb ˎ = fho.ˏ().ˋ("Message").ˎ("msg_setting_fragment");
            ((ILauncherMsgSwitchSettingProtocol) ˎ.ˊ()).setUri(this.ͺ);
            fjm ˏ = fjm.ˏ(fiu.ˊ().ˋ(this, ˎ));
            FragmentTransaction ˊ = ˏॱ().ˊ();
            ˊ.ˏ(b.ˍ, ˏ.ˏ(), "msg_setting");
            ˊ.ˋ();
        }
    }

    public void onDestroy() {
        super.onDestroy();
        eoj.ˋ().ˊ("LauncherMsgSwitchSettingActivity");
    }
}
